﻿@model Guardian.Domain.FirewallRule.FirewallRuleDto

@{
    ViewData["Title"] = "Create WAF Rule";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h1>Create Firewall Rule</h1>
<hr />
<div class="row">
    <div class="col-md-7">
        <form asp-action="Create">
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>

            <input asp-for="TargetId" type="hidden" class="form-control" />
            <div class="form-group">
                <label asp-for="Title" class="control-label"></label>
                <input asp-for="Title" class="form-control" />
                <span asp-validation-for="Title" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="RuleFor" class="control-label"></label>
                <select asp-for="RuleFor" class="form-control">
                    <option value="@Guardian.Infrastructure.Entity.RuleFor.Request">@Guardian.Infrastructure.Entity.RuleFor.Request.ToString()</option>
                    <option value="@Guardian.Infrastructure.Entity.RuleFor.Response">@Guardian.Infrastructure.Entity.RuleFor.Response.ToString()</option>
                </select>
                <span asp-validation-for="RuleFor" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Expression" class="control-label"></label>
                <textarea asp-for="Expression" class="form-control"  style="height:250px"></textarea>
                <span asp-validation-for="Expression" class="text-danger"></span>
            </div>
            <div class="form-group form-check">
                <label class="form-check-label">
                    <input class="form-check-input" asp-for="IsActive" /> @Html.DisplayNameFor(model => model.IsActive)
                </label>
            </div>
            <div class="form-group">
                <input type="submit" value="Create" class="btn btn-primary" />
            </div>
        </form>
    </div>
    <div class="col-md-5">
        <partial name="_FirewallRuleExplain.cshtml" />
    </div>
</div>

<div>
    <a asp-action="Index">Back to List</a>
</div>

